<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
     
     var num =10;
     /* console.log(num.toString());
     console.log(num+""); */
        /* console.log(parseInt('3.14'));
        console.log(parseInt('rem120px'));
        console.log(parseFloat('3.14')); */
        var year = prompt('请输入你的出生日期');
        var age = 2022 - year;
        alert('你的年龄为'+age+'岁');
    </script>
</body>
</html>